import xlrd
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--input',  type=str,default="filename.xlsx", help="--input  filename.xlsx")
parser.add_argument('--output',  type=str,default="filename.txt", help="--output filename.txt")
args = parser.parse_args()
inputfile = args.input
outputfile = args.output

def main():
    wb = xlrd.open_workbook(filename=inputfile)
    sheet = wb.sheets()[0]
    rows = sheet.get_rows()
    header = True
    with open(outputfile, 'w') as output:
        for row in rows:
            text=''
            if header:
                for i in range(len(row)):
                    text += "||" + row[i].value
                text += "||"
                header=False
            else:
                for i in range(len(row)):
                    text += "|" + row[i].value
                text += "|" 
            print(text, file=output)

if __name__=='__main__':
    main()